package ogmios.components;
import java.util.*;
import java.io.*;
/**
 * A file filter that can matches files with one of the given filters. It will not match directories.
 */
public class MultiOgmiosFileFilter extends OgmiosFileFilter
{
  public final Set<String> filters;
  public MultiOgmiosFileFilter(Set<String> filters, String extension, String filterDescription)
  {
   super(extension, filterDescription);
   this.filters = filters;
  }
  public boolean accept(File f)
  {
   if (f.isDirectory())
        return false;
   String name = f.getName().toLowerCase();
   int i = name.lastIndexOf(".");
   return i == -1 ? false : filters.contains(name.substring(i));
  }
}